Skip to content

feat: SDK update for version 22.1.0#151

Merged
ChiragAgg5k merged 4 commits into
mainfrom
dev
Jul 22, 2026
Merged

feat: SDK update for version 22.1.0#151
ChiragAgg5k merged 4 commits into
mainfrom
dev

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Jul 22, 2026

Copy link
Copy Markdown
Member

This PR contains updates to the SDK for version 22.1.0.

What's Changed

  • Updated: removed new_specification parameter from backups.create_restoration
  • Updated: Database.policies and Database.archives are now optional
  • Added: account OAuth2 consent methods list_consents, get_consent, delete_consent and consent token methods
  • Added: Oauth2Consent and Oauth2ConsentToken models
  • Added: oauth2.authorize_post method and oauth2.introspect key scope
  • Added: apps.list_o_auth2_scopes method and AppScope model
  • Added: geolocation, connection, and SDK attribution fields on ActivityEvent
  • Added: token parameter to sites.get_deployment_download
  • Updated: AppSecret.secret is always empty; the secret is returned only on creation

@ChiragAgg5k ChiragAgg5k changed the title feat: Python SDK update for version 22.1.0 feat: SDK update for version 22.1.0 Jul 22, 2026
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the Python SDK for Appwrite 22.1.0. The main changes are:

  • Bumps SDK version metadata to 22.1.0.
  • Adds OAuth2 consent, consent-token, authorization, and scope APIs.
  • Adds dedicated database models, status models, enums, examples, and tests.
  • Updates database, project, activity event, app secret, backups, sites, and billing model shapes.
  • Refreshes docs and service tests for the new SDK surface.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The latest changes do not modify the Project key expiration paths from the earlier review.

Important Files Changed

Filename Overview
appwrite/models/project.py Adds the wafEnabled field to the Project response model.
test/services/test_project.py Refreshes Project test fixtures to include the new wafEnabled response field.
appwrite/services/account.py Adds account OAuth2 consent and consent-token service methods.
appwrite/services/oauth2.py Adds new OAuth2 SDK methods and scope support.
appwrite/services/tables_db.py Updates TablesDB dedicated database service coverage.

Reviews (2): Last reviewed commit: "chore: merge main into dev for 22.1.0" | Re-trigger Greptile

Comment on lines 433 to 434

api_params['name'] = self._normalize_value(name)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Null Expiration Is Dropped

When callers pass expire=None to make an existing key unlimited, this changed path now omits expire instead of sending JSON null. The method still documents null as the unlimited-expiration value, so the server can leave the old expiration in place and the key can still expire.

Prompt To Fix With AI
This is a comment left during a code review.
Path: appwrite/services/project.py
Line: 433-434

Comment:
**Null Expiration Is Dropped**

When callers pass `expire=None` to make an existing key unlimited, this changed path now omits `expire` instead of sending JSON null. The method still documents null as the unlimited-expiration value, so the server can leave the old expiration in place and the key can still expire.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

Comment on lines 286 to +290
api_params['keyId'] = self._normalize_value(key_id)
api_params['name'] = self._normalize_value(name)
api_params['scopes'] = self._normalize_value(scopes)
api_params['expire'] = self._normalize_value(expire)
if expire is not None:
api_params['expire'] = self._normalize_value(expire)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unlimited Key Creation Loses Null

When creating a key without an expiration, the documented value is explicit null, and the previous SDK sent expire=None as JSON null. This guard drops the field, so deployments where the endpoint requires or distinguishes explicit null can reject the create request or apply a different default expiration.

Suggested change
api_params['keyId'] = self._normalize_value(key_id)
api_params['name'] = self._normalize_value(name)
api_params['scopes'] = self._normalize_value(scopes)
api_params['expire'] = self._normalize_value(expire)
if expire is not None:
api_params['expire'] = self._normalize_value(expire)
api_params['keyId'] = self._normalize_value(key_id)
api_params['name'] = self._normalize_value(name)
api_params['scopes'] = self._normalize_value(scopes)
api_params['expire'] = self._normalize_value(expire)
Prompt To Fix With AI
This is a comment left during a code review.
Path: appwrite/services/project.py
Line: 286-290

Comment:
**Unlimited Key Creation Loses Null**

When creating a key without an expiration, the documented value is explicit null, and the previous SDK sent `expire=None` as JSON null. This guard drops the field, so deployments where the endpoint requires or distinguishes explicit null can reject the create request or apply a different default expiration.

```suggestion
        api_params['keyId'] = self._normalize_value(key_id)
        api_params['name'] = self._normalize_value(name)
        api_params['scopes'] = self._normalize_value(scopes)
        api_params['expire'] = self._normalize_value(expire)
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Codex

@ChiragAgg5k
ChiragAgg5k merged commit 8b7af1f into main Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants